import VueRouter from 'vue-router'

// 导入对应的路由组件
import HomeContainer from './components/tabBar/HomeContainer'
import MemberContainer from './components/tabBar/MemberContainer'
import ShopCarContainer from './components/tabBar/ShopCarContainer'
import SearchContainer from './components/tabBar/SearchContainer'
import NewsList from './components/news/NewsList'
import NewsInfo from './components/news/NewsInfo'
import PhotoList from './components/photos/photoList.vue'


// 创建路由对象
var router = new VueRouter({
    routes: [// 第一个参数，配置路由规则的
      { path : '/',redirect: '/home'},
      { path : '/home',component: HomeContainer},
      { path : '/member',component: MemberContainer},
      { path : '/shopcar',component: ShopCarContainer},
      { path : '/search',component: SearchContainer},
      { path : '/home/newslist',component: NewsList},
      { path : '/home/newsinfo/:id',component: NewsInfo},
      { path : '/home/photolist',component: PhotoList},

    ],
    linkActiveClass: 'mui-active'// 覆盖默认的路由高亮类，默认的类叫做router-link-active
})

// 把路由对象暴露出去
export default router